package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * 雒鑫
 */
public class CodeUtil {
    //生成随机验证码
    public static String getRandomCode(Integer length){
        StringBuilder code = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            int randomNum = random.nextInt(10);
            code.append(randomNum);
        }
        return code.toString();

    }
}
